package com.tender.fallback;

import com.tender.WebSocketServerApi;
import com.tender.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class WebSocketServerApiFallback implements FallbackFactory<WebSocketServerApi> {

    @Override
    public WebSocketServerApi create(Throwable cause) {
        return new WebSocketServerApi() {
            @Override
            public Result<Integer> countAll() {
                return Result.success(0);
            }

            @Override
            public Result<Integer> pcCountAll() {
                return Result.success(0);
            }

            @Override
            public Result<Integer> ipadCountAll() {
                return Result.success(0);
            }

            @Override
            public Result<Integer> appCountAll() {
                return Result.success(0);
            }
        };
    }
}
